/**
 * @author xh
 * 懒汉模式
 */
public class Wife2 {
    // 一开始没有新建实例
    private static Wife2 wife;

    private Wife2() {
    }

    // 需要时再新建
    public static Wife2 getWife() {
        if (wife == null) {
            wife = new Wife2();
        }
        return wife;
    }
}
